using UnityEngine.EventSystems;
using UnityEngine.UI;

public class UiCraftSlot : UiItemSlot
{
    protected override void Awake()
    {
        base.Awake();
        itemImage = transform.GetChild(1).GetComponent<Image>();
    }

    public void Setup(ItemDataEquipment data)
    {
        if (!data) return;
        Item.data = data;
        itemName.text = data.ItemName;
        itemImage.sprite = data.ItemIcon;
    }

    public override void OnPointerDown(PointerEventData eventData)
    {
        if (Item == null) return;
        Ui.UiCraftWindow.Setup(Item.data as ItemDataEquipment);
    }
}